<style type="text/css">
  .btn_rd{ color: #FFF; background: #CDA60E; text-align: center; text-decoration: none; padding: 4px 6px 4px 6px; margin-right: 4px;}
</style>
<table class="search">
	<tbody>
		<tr>
			<td style="width:50px;">信箱：</td>
			<td>
        <a href="{:U(MODULE_NAME.'/Message/receive')}" class="current">收件箱</a>
				<a href="{:U(MODULE_NAME.'/Message/send')}">已发送</a>
			</td>
		</tr>
		<tr>
			<td>状态：</td>
			<td>
        	<a href="javascript:;" onclick="change('status','0');" class="<if condition="$status eq 0 ">current</if>" >全部</a>
		  		<a href="javascript:;" onclick="change('status','1');" class="<if condition="$status eq 1 ">current</if>" >未读</a>
        	<a href="javascript:;" onclick="change('status','2');" class="<if condition="$status eq 2 ">current</if>" >已读</a>
			</td>
		</tr>
    <tr>
      <td style="width:50px;">关键搜索：</td>
      <td>
        <form action="{:U(MODULE_NAME.'/Message/receive')}" method="get">
          <input type="text" name="keyword" class="input-m" placeholder="请输入关键字" value="{$keyword}">
          <button type="submit" class="button-green">查询</button>
        </form>
      </td>
    </tr>
	</tbody>
</table>

<div class="list-menu">
  <a href="javascript:;" class="button-green" onclick="sent()">发送信息</a>
</div>
<table class="list">
		<thead>
			<tr>
          <th width="20px"><img src="/Public/image/mail1.jpg"></th>
          <th width="60px">发件人</th>
          <th>主题</th>
          <th width="150px">时间</th>
          
      </tr>
		</thead>
  <tbody id="name">
		<foreach name="list" item="message">
			<tr>
         <td><if condition="$message.isTransmit eq 1 "><img src="/Public/image/mail3.jpg"><elseif condition="$message.isNew eq true"/><img src="/Public/image/mail2.jpg"><else /><img src="/Public/image/mail1.jpg"></if></td>
         <td>{$message.sendName}</td>
         <td><a href="{:U(MODULE_NAME.'/Message/detail',array('id'=>$message['id']))}"><strong>{$message.title|subtext=50}</strong><font color="#A0A0A0">-{$message.content}</font></a></td>
         <td>{$message.sendTime}</td>
       </tr>
    </foreach>
  </tbody>
</table>
<div class="page" style="clear: both;">{$page}</div>
<input type="hidden" id="type" value="{$type}">
<input type="hidden" id="status" value="{$status}">
<script type="text/javascript">
function change($id,$name)
{
    $("#"+$id).val($name);
    var url =  '?';
    url += '&status='+$("#status").val();
   
    window.location.href = '{:U(MODULE_NAME.'/Message/receive')}'+url;
};
function sent()
{
    window.location.href = '{:U(MODULE_NAME.'/Message/sent')}';
};
</script>